<?php
    function printsize($free)
    {
	$i=0;
	while($free>1024)
	{
	    $i++;
	    $free=round($free/1024);
	}
        $r=$free;
	switch($i)
	{
	    case 0: $r.="B";break;
	    case 1: $r.="KB";break;
	    case 2: $r.="MB";break;
	    case 3: $r.="GB";break;
	}
	return $r;
    }

    $total=disk_total_space("/home/pcaban/");
    $free=disk_free_space("/home/pcaban/");
    print("disk_total_space = ".printsize($total)."<br>");
    print("disk_free_space = ".printsize($free)."<br>");
    print("procentowo: ".round($free/$total*100)."% wolnego<br>");
?>